package line;
import point.ObjectPoint;
import environment.Simulation;

/**
 * 
 * @author Mechael Deng, Xi Du
 * Muscles class
 */
public class Muscle extends Line {
    /**
     * @param amplitude
     */
    private double amplitude;



  /**
   * 
   * @param start start point
   * @param end end point
   * @param length rest length
   * @param kVal k factor
   * @param amp amplitude
   */
  public Muscle(final ObjectPoint start, final ObjectPoint end,
          final double length, final double kVal, final double amp) {
      super(start, end, length, kVal);
      amplitude = amp;
  }
/**
 * @param canvas simulation class
 * @param dt time
 */
  public final void update(final Simulation canvas, final double dt) {
      double distance=Math.sin(
              System.currentTimeMillis()) * amplitude;
      applyHookesForce(getmyK(), distance);
  }

}
